<?php

namespace Home\Controller;
use OT\DataDictionary;

class IndexController extends HomeController {
        //系统首页
        public function index($fid){
            $nickname       =   I('nickname');
            $map['status']  =   array('egt',0);
            if(is_numeric($nickname)){
                $map['id|title']=   array(intval($nickname),array('like','%'.$nickname.'%'),'_multi'=>true);
            }else{
                $map['title']    =   array('like', '%'.(string)$nickname.'%');
            }

            $list   = $this->lists('shop',$map,'id');
            //$img   = $this->lists('price',$map,'id');
            dump($list);die;
            
            $shop = D('shop');
            $res = $shop->where(array('fid'=>$id))->select();
            
            
            
            
            $a=M('shop')->join("onethink_price on onethink_shop.id=onethink_price.sid")->select();
            $b=M('cate')->where(array('fid'=>$fid))->select();
            //dump($b);
            foreach($b as $v){
                $arr[]=$v['id'];
            }
            $c=implode(',',$arr);
            $where['fid']=array('in',$c);
            $a=M('shop')->where($where)->select();
            
            //dump(M('shop')->getLastSql());
            //dump(M('shop')->getLastSql());
            //dump($img);die;
            $this->assign('_list', $a);
            
            $this->meta_title = '商品';
            $this->display();
        }

}